package com.yj.jason.jsondemo;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.view.View;
import android.widget.Toast;

import com.yj.jason.baselibrary.view.RecyclerView.CommonAdapter.CommonRecyclerAdapter;
import com.yj.jason.baselibrary.view.RecyclerView.CommonAdapter.ViewHolder;

import java.util.ArrayList;
import java.util.List;

public class MDToolBarActivity extends AppCompatActivity{
    private RecyclerView recyclerView;
    private List<String> mList=new ArrayList<>();

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_ma_toolbar);
        recyclerView=findViewById(R.id.recyclerView);

        for(int i=0;i<20;i++){
            mList.add("dfjfj "+i);
        }

        recyclerView.setLayoutManager(new LinearLayoutManager(this));

        recyclerView.setAdapter(new CommonRecyclerAdapter<String>(this,mList,R.layout.item_2) {
            @Override
            public void convert(ViewHolder holder, final String item) {
                holder.setText(R.id.tv_item,item);

            }


        });
    }
}
